Optimal. Leaf size=83 \[ \frac {(a+b)^3 \log (\cosh (c+d x))}{d}-\frac {b (a+b)^2 \tanh ^2(c+d x)}{2 d}-\frac {(a+b) \left (a+b \tanh ^2(c+d x)\right )^2}{4 d}-\frac {\left (a+b \tanh ^2(c+d x)\right )^3}{6 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.08, antiderivative size = 83, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3751, 455, 45}
\begin {gather*} -\frac {b (a+b)^2 \tanh ^2(c+d x)}{2 d}-\frac {(a+b) \left (a+b \tanh ^2(c+d x)\right )^2}{4 d}-\frac {\left (a+b \tanh ^2(c+d x)\right )^3}{6 d}+\frac {(a+b)^3 \log (\cosh (c+d x))}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 45
Rule 455
Rule 3751
Rubi steps
\begin {align*} \int \tanh (c+d x) \left (a+b \tanh ^2(c+d x)\right )^3 \, dx &=\frac {\text {Subst}\left (\int \frac {x \left (a+b x^2\right )^3}{1-x^2} \, dx,x,\tanh (c+d x)\right )}{d}\\ &=\frac {\text {Subst}\left (\int \frac {(a+b x)^3}{1-x} \, dx,x,\tanh ^2(c+d x)\right )}{2 d}\\ &=\frac {\text {Subst}\left (\int \left (-b (a+b)^2+\frac {(a+b)^3}{1-x}-b (a+b) (a+b x)-b (a+b x)^2\right ) \, dx,x,\tanh ^2(c+d x)\right )}{2 d}\\ &=\frac {(a+b)^3 \log (\cosh (c+d x))}{d}-\frac {b (a+b)^2 \tanh ^2(c+d x)}{2 d}-\frac {(a+b) \left (a+b \tanh ^2(c+d x)\right )^2}{4 d}-\frac {\left (a+b \tanh ^2(c+d x)\right )^3}{6 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.17, size = 76, normalized size = 0.92 \begin {gather*} -\frac {-2 (a+b)^3 \log (\cosh (c+d x))+b (a+b)^2 \tanh ^2(c+d x)+\frac {1}{2} (a+b) \left (a+b \tanh ^2(c+d x)\right )^2+\frac {1}{3} \left (a+b \tanh ^2(c+d x)\right )^3}{2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.39, size = 151, normalized size = 1.82
method | result | size |
derivativedivides | \(\frac {\frac {\left (-a^{3}-3 a^{2} b -3 a \,b^{2}-b^{3}\right ) \ln \left (1+\tanh \left (d x +c \right )\right )}{2}-\frac {3 a \,b^{2} \left (\tanh ^{2}\left (d x +c \right )\right )}{2}-\frac {3 a^{2} b \left (\tanh ^{2}\left (d x +c \right )\right )}{2}-\frac {3 a \,b^{2} \left (\tanh ^{4}\left (d x +c \right )\right )}{4}-\frac {b^{3} \left (\tanh ^{6}\left (d x +c \right )\right )}{6}-\frac {\left (a^{3}+3 a^{2} b +3 a \,b^{2}+b^{3}\right ) \ln \left (\tanh \left (d x +c \right )-1\right )}{2}-\frac {b^{3} \left (\tanh ^{2}\left (d x +c \right )\right )}{2}-\frac {b^{3} \left (\tanh ^{4}\left (d x +c \right )\right )}{4}}{d}\) | \(151\) |
default | \(\frac {\frac {\left (-a^{3}-3 a^{2} b -3 a \,b^{2}-b^{3}\right ) \ln \left (1+\tanh \left (d x +c \right )\right )}{2}-\frac {3 a \,b^{2} \left (\tanh ^{2}\left (d x +c \right )\right )}{2}-\frac {3 a^{2} b \left (\tanh ^{2}\left (d x +c \right )\right )}{2}-\frac {3 a \,b^{2} \left (\tanh ^{4}\left (d x +c \right )\right )}{4}-\frac {b^{3} \left (\tanh ^{6}\left (d x +c \right )\right )}{6}-\frac {\left (a^{3}+3 a^{2} b +3 a \,b^{2}+b^{3}\right ) \ln \left (\tanh \left (d x +c \right )-1\right )}{2}-\frac {b^{3} \left (\tanh ^{2}\left (d x +c \right )\right )}{2}-\frac {b^{3} \left (\tanh ^{4}\left (d x +c \right )\right )}{4}}{d}\) | \(151\) |
risch | \(-a^{3} x -3 a^{2} b x -3 a \,b^{2} x -b^{3} x -\frac {2 a^{3} c}{d}-\frac {6 a^{2} b c}{d}-\frac {6 a \,b^{2} c}{d}-\frac {2 b^{3} c}{d}+\frac {2 b \,{\mathrm e}^{2 d x +2 c} \left (9 a^{2} {\mathrm e}^{8 d x +8 c}+18 a b \,{\mathrm e}^{8 d x +8 c}+9 b^{2} {\mathrm e}^{8 d x +8 c}+36 a^{2} {\mathrm e}^{6 d x +6 c}+54 a b \,{\mathrm e}^{6 d x +6 c}+18 b^{2} {\mathrm e}^{6 d x +6 c}+54 a^{2} {\mathrm e}^{4 d x +4 c}+72 a b \,{\mathrm e}^{4 d x +4 c}+34 b^{2} {\mathrm e}^{4 d x +4 c}+36 a^{2} {\mathrm e}^{2 d x +2 c}+54 a b \,{\mathrm e}^{2 d x +2 c}+18 b^{2} {\mathrm e}^{2 d x +2 c}+9 a^{2}+18 a b +9 b^{2}\right )}{3 d \left (1+{\mathrm e}^{2 d x +2 c}\right )^{6}}+\frac {\ln \left (1+{\mathrm e}^{2 d x +2 c}\right ) a^{3}}{d}+\frac {3 \ln \left (1+{\mathrm e}^{2 d x +2 c}\right ) a^{2} b}{d}+\frac {3 \ln \left (1+{\mathrm e}^{2 d x +2 c}\right ) a \,b^{2}}{d}+\frac {\ln \left (1+{\mathrm e}^{2 d x +2 c}\right ) b^{3}}{d}\) | \(353\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 351 vs.
\(2 (77) = 154\).
time = 0.51, size = 351, normalized size = 4.23 \begin {gather*} \frac {1}{3} \, b^{3} {\left (3 \, x + \frac {3 \, c}{d} + \frac {3 \, \log \left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}{d} + \frac {2 \, {\left (9 \, e^{\left (-2 \, d x - 2 \, c\right )} + 18 \, e^{\left (-4 \, d x - 4 \, c\right )} + 34 \, e^{\left (-6 \, d x - 6 \, c\right )} + 18 \, e^{\left (-8 \, d x - 8 \, c\right )} + 9 \, e^{\left (-10 \, d x - 10 \, c\right )}\right )}}{d {\left (6 \, e^{\left (-2 \, d x - 2 \, c\right )} + 15 \, e^{\left (-4 \, d x - 4 \, c\right )} + 20 \, e^{\left (-6 \, d x - 6 \, c\right )} + 15 \, e^{\left (-8 \, d x - 8 \, c\right )} + 6 \, e^{\left (-10 \, d x - 10 \, c\right )} + e^{\left (-12 \, d x - 12 \, c\right )} + 1\right )}}\right )} + 3 \, a b^{2} {\left (x + \frac {c}{d} + \frac {\log \left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}{d} + \frac {4 \, {\left (e^{\left (-2 \, d x - 2 \, c\right )} + e^{\left (-4 \, d x - 4 \, c\right )} + e^{\left (-6 \, d x - 6 \, c\right )}\right )}}{d {\left (4 \, e^{\left (-2 \, d x - 2 \, c\right )} + 6 \, e^{\left (-4 \, d x - 4 \, c\right )} + 4 \, e^{\left (-6 \, d x - 6 \, c\right )} + e^{\left (-8 \, d x - 8 \, c\right )} + 1\right )}}\right )} + 3 \, a^{2} b {\left (x + \frac {c}{d} + \frac {\log \left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}{d} + \frac {2 \, e^{\left (-2 \, d x - 2 \, c\right )}}{d {\left (2 \, e^{\left (-2 \, d x - 2 \, c\right )} + e^{\left (-4 \, d x - 4 \, c\right )} + 1\right )}}\right )} + \frac {a^{3} \log \left (\cosh \left (d x + c\right )\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 4298 vs.
\(2 (77) = 154\).
time = 0.46, size = 4298, normalized size = 51.78 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 211 vs.
\(2 (71) = 142\).
time = 0.21, size = 211, normalized size = 2.54 \begin {gather*} \begin {cases} a^{3} x - \frac {a^{3} \log {\left (\tanh {\left (c + d x \right )} + 1 \right )}}{d} + 3 a^{2} b x - \frac {3 a^{2} b \log {\left (\tanh {\left (c + d x \right )} + 1 \right )}}{d} - \frac {3 a^{2} b \tanh ^{2}{\left (c + d x \right )}}{2 d} + 3 a b^{2} x - \frac {3 a b^{2} \log {\left (\tanh {\left (c + d x \right )} + 1 \right )}}{d} - \frac {3 a b^{2} \tanh ^{4}{\left (c + d x \right )}}{4 d} - \frac {3 a b^{2} \tanh ^{2}{\left (c + d x \right )}}{2 d} + b^{3} x - \frac {b^{3} \log {\left (\tanh {\left (c + d x \right )} + 1 \right )}}{d} - \frac {b^{3} \tanh ^{6}{\left (c + d x \right )}}{6 d} - \frac {b^{3} \tanh ^{4}{\left (c + d x \right )}}{4 d} - \frac {b^{3} \tanh ^{2}{\left (c + d x \right )}}{2 d} & \text {for}\: d \neq 0 \\x \left (a + b \tanh ^{2}{\left (c \right )}\right )^{3} \tanh {\left (c \right )} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 216 vs.
\(2 (77) = 154\).
time = 0.53, size = 216, normalized size = 2.60 \begin {gather*} -\frac {3 \, {\left (a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}\right )} {\left (d x + c\right )} - 3 \, {\left (a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}\right )} \log \left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right ) - \frac {2 \, {\left (9 \, {\left (a^{2} b + 2 \, a b^{2} + b^{3}\right )} e^{\left (10 \, d x + 10 \, c\right )} + 18 \, {\left (2 \, a^{2} b + 3 \, a b^{2} + b^{3}\right )} e^{\left (8 \, d x + 8 \, c\right )} + 2 \, {\left (27 \, a^{2} b + 36 \, a b^{2} + 17 \, b^{3}\right )} e^{\left (6 \, d x + 6 \, c\right )} + 18 \, {\left (2 \, a^{2} b + 3 \, a b^{2} + b^{3}\right )} e^{\left (4 \, d x + 4 \, c\right )} + 9 \, {\left (a^{2} b + 2 \, a b^{2} + b^{3}\right )} e^{\left (2 \, d x + 2 \, c\right )}\right )}}{{\left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right )}^{6}}}{3 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.25, size = 123, normalized size = 1.48 \begin {gather*} x\,\left (a^3+3\,a^2\,b+3\,a\,b^2+b^3\right )-\frac {{\mathrm {tanh}\left (c+d\,x\right )}^2\,\left (3\,a^2\,b+3\,a\,b^2+b^3\right )}{2\,d}-\frac {\ln \left (\mathrm {tanh}\left (c+d\,x\right )+1\right )\,\left (a^3+3\,a^2\,b+3\,a\,b^2+b^3\right )}{d}-\frac {{\mathrm {tanh}\left (c+d\,x\right )}^4\,\left (b^3+3\,a\,b^2\right )}{4\,d}-\frac {b^3\,{\mathrm {tanh}\left (c+d\,x\right )}^6}{6\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________